comp2013group7fandomcom-20200214-history
User blog:Chchiu/Arduino blinds module engineering - Final Product
Finally after weeks of making the module, it was finished to a high standard as you can see on the pictures. It was a combine of hardware and software making the module automated controller to run a motor that can operate the opening and closing of blinds. The final product was design so that everything can fit in a box to carry around and was protected from damange. I will guide through the many problems i had through creating the module from stretch to finish. From creating simple circuits for the sensors, hacking the motor shield so it can be stacked with the arduino and wifi shield to implementation of the code. The source code can be download on RoboHome GitHub page. Building these modules can be separated in these parts: 1.Requirements and parts 2.Wiring the sensors. 3.Wiring the Arduino, Wi-Fi and motor shields. 4.Hacking the motor shield. 5.Programming Code. Requirements and parts *1. Arduino mega board *2. Wifi shield *3. Motor shield *4. 3 x Hall effect sensor *5. Breadboard *6. 100 ohm resistor *7. 12 V Stepper Motor *8. 12V AC adapter Wiring the sensors This is very danger because the motor is running in 12V and could burn the Arduino very quickly. We spend some time to learn the structure of Arduino and the Motor shield. We build a prototype using the breadboard and making sure it works. Then we solder and put everything together. First connect the Hall effect sensors with the resistor to the Arduino. *Connect pin 1 of the switch to the Arduino +5V supply *Connect pin 2 to GND *Connect pin 3 to Arduino input pin Then connect the 12 V stepper motor to the motor shield in the M3 and M4 slot and connect the external power. Some tutorial of the motor shield at http://www.ladyada.net/make/mshield/make.html Then stack the motor shield on the adurino and test it is working, I also changed some PI resistor on the motor shield because it’s getting too hot. Hacking the motor shield We need to do some hacking to the motor shield so it can be stacked with the Arduino and Wi-Fi shield. Now place the Wi-Fi shield under the motor shield and on top of the Arduino Now for hardware hack. The Arduino communicates to the Wi-Fi shield and motor shield on several different pins but pin 12 is common to both and this causes conflict. To fix this, we are need to do a software hack so that data the Arduino usually sends through pin 12 goes through pin 9 instead. We need to find motors.h on the computer, find the line #define MOTORLATCH 12 and change that to a 9. Initially, the motor shield had issues with overheating after a short period. This was because the H-Bridge was not designed for a 12V supply and so the default H-Bridge was replaced with a new one that was capable of this. (http://download.siliconexpert.com/pdfs/2008/04/20/urlc/txn/sn754410.pdf) Programming Code The final step is to write the C code to make the module works as the blind module. The C code of running the module is on Github blinds.ino this will get the blind status and can control it to open, middle or close. The image show the final product that was finished to a high standard as you can see on the pictures. It was a combine of hardware and software making the module-automated controller to run a motor that can operate the opening and closing of blinds. The final product was design so that everything can fit in a box to carry around and was protected from damage. Category:Blog posts